<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" language="java" import="java.util.*"%>
<%@page import="com.pub.database.*"%>

<%
java.util.Hashtable<String,Hashtable<String,Object>> htDetailData=null;
String flow_num=request.getParameter("flow_num");
String db_alias=request.getParameter("db_alias");
String source_charset=request.getParameter("source_charset");
String target_charset=request.getParameter("target_charset");

 QueryBean obj=null;

try{

    if(flow_num==null || flow_num.equals("null")){
    return;
  }

    obj=new QueryBean(db_alias,false,source_charset,target_charset);
    String flow_code=flow_num.substring(0,3);


    String strSql = "select a.flow_no,c.flow_desc,a.employee_no,b.employee_name_c,a.sign_note,to_char(a.sign_date,'yyyy/mm/dd hh24:mi:ss') as sign_date from wkf_log a, pnl_employee b,floweng_setup c ";
    strSql+="where a.flow_code='"+flow_code+"' and a.flow_num='"+flow_num+"' and a.employee_no=b.employee_no ";
    strSql+="and a.flow_no=c.flow_no and a.flow_code=c.flow_code and a.log_st='L' order by a.sign_date desc";

    htDetailData=obj.hashtableSQL(strSql);
    if(htDetailData!=null && htDetailData.size() >0)
    {
%>
<LINK HREF="general/workflow.css" REL="STYLESHEET" TYPE="TEXT/CSS">
<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0" id="tbl_app_note_list">
  <TR>
    <TD colspan="4" CLASS="td_head_1" ID="reject_detail_name_id" ><div align="center">審核意見</div></TD>
  </TR>
  <%
    for(int i=0;i<htDetailData.size();i++)
    {

      %>
  <TR>
    <TD width="15%" CLASS="td_head_1" ID="reject_detail_name_id" >填寫者:</TD>
    <TD width="35%" CLASS="td_content_1" ID="reject_detail_name_id" ><%=(((java.util.Hashtable<String,Object>)htDetailData.get(String.valueOf(i))).get("employee_no".toUpperCase())!=null ? ((java.util.Hashtable<String,Object>)htDetailData.get(String.valueOf(i))).get("employee_no".toUpperCase()).toString() : " ")%> <%=(((java.util.Hashtable<String,Object>)htDetailData.get(String.valueOf(i))).get("employee_name_c".toUpperCase())!=null ? ((java.util.Hashtable<String,Object>)htDetailData.get(String.valueOf(i))).get("employee_name_c".toUpperCase()).toString() : " ")%> </TD>
    <TD width="15%" CLASS="td_head_1" ID="reject_detail_name_id" >填寫時間:</td>
    <TD width="35%" CLASS="td_content_1" ID="reject_detail_name_id" ><%=(((java.util.Hashtable<String,Object>)htDetailData.get(String.valueOf(i))).get("sign_date".toUpperCase())!=null ? ((java.util.Hashtable<String,Object>)htDetailData.get(String.valueOf(i))).get("sign_date".toUpperCase()).toString() : " ")%></td>
  </TR>
  <TR>
    <TD ID="reject_detail_name_id" CLASS="td_head_1" WIDTH="15%" >意見內容：</TD>
    <TD colspan="3" CLASS="td_content_1" ><%=(((java.util.Hashtable<String,Object>)htDetailData.get(String.valueOf(i))).get("sign_note".toUpperCase())!=null ? ((java.util.Hashtable<String,Object>)htDetailData.get(String.valueOf(i))).get("sign_note".toUpperCase()).toString().replaceAll("\n","<br/>") : " ")%>  </TR>
  <%
      }

%>
</TABLE>
  <%
    }//if data found


}//try
 catch(Exception e){
   e.printStackTrace();
 }
 finally{
   try{obj.close();}catch(Exception e){System.out.println("can not close querybean in action.java");}
   obj=null;
 }
      %>

